package com.example.baseweb.repository;

import com.example.baseweb.entity.OrderDetail;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import java.util.List;

@Repository
public interface OrderDetailRepository extends JpaRepository<OrderDetail, Long> {
    
    // 根据订单ID查询订单明细
    List<OrderDetail> findByOrderIdOrderByCreateTimeAsc(Long orderId);
    
    // 根据菜品ID查询订单明细（统计用）
    List<OrderDetail> findByDishId(Long dishId);
} 